<%@ page language="java" import="java.util.*, com.rmt.www.vo.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'requestdetail.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link href="css/Site.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" language="javascript" src="js/jquery-1.7.1.js"></script>
    <script>
        $(function(){
        	var url = "processRequestAction";
        	var rid = null;
        	var artifacttype= '<s:property value="artifacttype"/>';
        	var pid = null;
        	if (artifacttype == "feature") {
        		rid = '<s:property value="featureArtifactRequest.id" />';
        		pid = '<s:property value="pid"/>';
        	} else if (artifacttype == "requirement") {
        		rid = '<s:property value="requirementArtifactRequest.id" />';
        		pid = '<s:property value="pid"/>';
        	} else if (artifacttype == "design") {
        		rid = '<s:property value="designArtifactRequest.id" />';
        		pid = '<s:property value="pid"/>';
        	} else if (artifacttype == "implementation") { 	
        		rid = '<s:property value="implementationArtifactRequest.id" />';
        		pid = '<s:property value="pid"/>';
        	} else { 
        		rid = '<s:property value="testArtifactRequest.id" />';
        		pid = '<s:property value="pid"/>';
        	}
        	$('input[value="accept"]').click(function(){
        		if (confirm("Are you sure to accept the request?")) {
        	       //alert("sure to accept");
        	       url += "?perf=accept&rid=" + rid + "&artifacttype=" + artifacttype+"&pid=" + pid;
        	       window.opener = null;
        	       window.close();
        	       window.open(url);
        		}
        	});
        	
        	$('input[value="decline"]').click(function(){
        	   if (confirm("Are you sure to decline the request?")) {
        		   //alert("sure decline");
        		   url += "?perf=decline&rid=" + rid + "&artifacttype=" + artifacttype + "&pid=" + pid ;
        		   window.opener = null;
                   window.close();
        		   window.open(url);
        	   }	
        	});
        })
    </script>
  </head>
  
  <body>
  <div class='page' id='wrap'>
    <div id="header" style='background-color: #5c87b2' >
            <div id="title" >
                <h1>&nbsp;&nbsp;RMT Service for administrator</h1>
            </div>
              
                <div id="logindisplay">
               welcome <%=((User)session.getAttribute("currentUser")).getName()%>,  <a href='../RMT'>logout</a>
             
            </div>
             <br/>
            <div id="menucontainer">
                <ul id="menu">
                	<li><a href="adminHomeAction">Home</a></li>              
                    <li><a href='getProjectsForAdmin'>Projects</a></li>
                    <li><a href='accountManageAction?manageTarget=account'>Users</a></li>
                </ul>
            
            </div>
          
        </div>
    <div  style='background-color: #FFFFFF'>
   <h3>View all requests</h3> <br>
    <table align='center'>
        <thead>
            <tr>
            	<th>Artifact items</th>
                <th>Request Detail Info</th>
                <th>Original Artifact Info</th>
                <s:property value="artifacttype"/>
            </tr>
        </thead>
        <s:if test='artifacttype == "feature"'>
	        <tbody>
	            <tr>
	            	<td>title</td>
	            	<td><s:property value="featureArtifactRequest.title"/></td>
	            	<td><s:property value="featureArtifact.title"/></td>
	            </tr>
	            
	            <tr>
	            	<td>author</td>
	            	<td><s:property value="featureArtifactRequest._authorname"/></td>
	            	<td><s:property value="featureArtifact._authorname"/></td>
	            </tr>
	            
	            <tr>
	            	<td>version</td>
	            	<td><s:property value="featureArtifactRequest.version"/></td>
	            	<td><s:property value="featureArtifact.version"/></td>
	            </tr>
	            
	            <tr>
	            	<td>priority</td>
	            	<td><s:property value="featureArtifactRequest.priority"/></td>
	            	<td><s:property value="featureArtifact.priority"/></td>
	            </tr>
	            
	            <tr>
	            	<td>source</td>
	            	<td><s:property value="featureArtifactRequest.source"/></td>
	            	<td><s:property value="featureArtifact.source"/></td>
	            </tr>
	            
	            <tr>
	            	<td>rational</td>
	            	<td><s:property value="featureArtifactRequest.rational"/></td>
	            	<td><s:property value="featureArtifact.rational"/></td>
	            </tr>
	            
	            <tr>
	            	<td>latest updater</td>
	            	<td><s:property value="featureArtifactRequest._updatername"/></td>
	            	<td><s:property value="featureArtifact._updatername"/></td>
	            </tr>
	            
	            <tr>
	            	<td>description</td>
	            	<td><s:property value="featureArtifactRequest.description"/></td>
	            	<td><s:property value="featureArtifact.description"/></td>
	            </tr>
	            
	            <tr>
	            	<td>status</td>
	            	<td><s:property value="featureArtifactRequest.status"/></td>
	            	<td><s:property value="featureArtifact.status"/></td>
	            </tr>
	            
	            <tr>
	            	<td>cost</td>
	            	<td><s:property value="featureArtifactRequest.cost"/></td>
	            	<td><s:property value="featureArtifact.cost"/></td>
	            </tr>
	            
	            <tr>
	            	<td>effort</td>
	            	<td><s:property value="featureArtifactRequest.effort"/></td>
	            	<td><s:property value="featureArtifact.effort"/></td>
	            </tr>
	            
	            <tr>
	            	<td>risk</td>
	            	<td><s:property value="featureArtifactRequest.risk"/></td>
	            	<td><s:property value="featureArtifact.risk"/></td>
	            </tr>
	            
	            <tr>
	            	<td>updated times</td>
	            	<td><s:property value="featureArtifactRequest.updatedtimes"/></td>
	            	<td><s:property value="featureArtifact.updatedtimes"/></td>
	            </tr>

	        </tbody>
        </s:if>
        
        
        
        
        <s:if test='artifacttype == " "'>
	        <tbody>
	            <tr>
	            	<td>title</td>
	            	<td><s:property value="requirementArtifactRequest.title"/></td>
	            	<td><s:property value="requirementArtifact.title"/></td>
	            </tr>
	            
	          	<tr>
	            	<td>author</td>
	            	<td><s:property value="requirementArtifactRequest._authorname"/></td>
	            	<td><s:property value="requirementArtifact._authorname"/></td>
	            </tr>
	            
	            <tr>
	            	<td>version</td>
	            	<td><s:property value="requirementArtifactRequest.version"/></td>
	            	<td><s:property value="requirementArtifact.version"/></td>
	            </tr>
	            
	            <tr>
	            	<td>priority</td>
	            	<td><s:property value="requirementArtifactRequest.priority"/></td>
	            	<td><s:property value="requirementArtifact.priority"/></td>
	            </tr>
	            
	            <tr>
	            	<td>source</td>
	            	<td><s:property value="requirementArtifactRequest.source"/></td>
	            	<td><s:property value="requirementArtifact.source"/></td>
	            </tr>
	            
	            <tr>
	            	<td>rational</td>
	            	<td><s:property value="requirementArtifactRequest.rational"/></td>
	            	<td><s:property value="requirementArtifact.rational"/></td>
	            </tr>
	            
	            <tr>
	            	<td>latest updater</td>
	            	<td><s:property value="requirementArtifactRequest_updatername"/></td>
	            	<td><s:property value="requirementArtifact_updatername"/></td>
	            </tr>
	            
	            <tr>
	            	<td>status</td>
	            	<td><s:property value="requirementArtifactRequest.status"/></td>
	            	<td><s:property value="requirementArtifact.status"/></td>
	            </tr>
	            
	            <tr>
	            	<td>description</td>
	            	<td><s:property value="requirementArtifactRequest.description"/></td>
	            	<td><s:property value="requirementArtifact.description"/></td>
	            </tr>

				<tr>
	            	<td>cost</td>
	            	<td><s:property value="requirementArtifactRequest.cost"/></td>
	            	<td><s:property value="requirementArtifact.cost"/></td>
	            </tr>
	            
	            <tr>
	            	<td>effort</td>
	            	<td><s:property value="requirementArtifactRequest.effort"/></td>
	            	<td><s:property value="requirementArtifact.effort"/></td>
	            </tr>
	            
	            <tr>
	            	<td>risk</td>
	            	<td><s:property value="requirementArtifactRequest.risk"/></td>
	            	<td><s:property value="requirementArtifact.risk"/></td>
	            </tr>
	            
	            <tr>
	            	<td>updated times</td>
	            	<td><s:property value="requirementArtifactRequest.updatedtimes"/></td>
	            	<td><s:property value="requirementArtifact.updatedtimes"/></td>
	            </tr>
	        </tbody>
        </s:if>
        
        
        
        
        
        
                <s:if test='artifacttype == "design"'>
	        <tbody>
	            <tr>
	            	<td>title</td>
	            	<td><s:property value="designArtifactRequest.title"/></td>
	            	<td><s:property value="designArtifact.title"/></td>
	            </tr>
	            
	         	<tr>
	            	<td>priority</td>
	            	<td><s:property value="designArtifactRequest.priority"/></td>
	            	<td><s:property value="designArtifact.priority"/></td>
	            </tr>
	            
	            <tr>
	            	<td>effort</td>
	            	<td><s:property value="designArtifactRequest.effort"/></td>
	            	<td><s:property value="designArtifact.effort"/></td>
	            </tr>
	            
	            <tr>
	            	<td>cost</td>
	            	<td><s:property value="designArtifactRequest.cost"/></td>
	            	<td><s:property value="designArtifact.cost"/></td>
	            </tr>
	            
	            <tr>
	            	<td>risk</td>
	            	<td><s:property value="designArtifactRequest.risk"/></td>
	            	<td><s:property value="designArtifact.risk"/></td>
	            </tr>
	            
	            <tr>
	            	<td>comment</td>
	            	<td><s:property value="designArtifactRequest.comment"/></td>
	            	<td><s:property value="designArtifact.comment"/></td>
	            </tr>
	            
	            <tr>
	            	<td>latest updater</td>
	            	<td><s:property value="designArtifactRequest._updatername"/></td>
	            	<td><s:property value="designArtifact._updatername"/></td>
	            </tr>
	            
	            <tr>
	            	<td>version</td>
	            	<td><s:property value="designArtifactRequest.version"/></td>
	            	<td><s:property value="designArtifact.version"/></td>
	            </tr>
	            
	            <tr>
	            	<td>status</td>
	            	<td><s:property value="designArtifactRequest.status"/></td>
	            	<td><s:property value="designArtifact.status"/></td>
	            </tr>
	            
	            <tr>
	            	<td>architect</td>
	            	<td><s:property value="designArtifactRequest.architect"/></td>
	            	<td><s:property value="designArtifact.architect"/></td>
	            </tr>
	            
	            <tr>
	            	<td>consideration</td>
	            	<td><s:property value="designArtifactRequest.consideration"/></td>
	            	<td><s:property value="designArtifact.consideration"/></td>
	            </tr>
	            
	            <tr>
	            	<td>input</td>
	            	<td><s:property value="designArtifactRequest.input"/></td>
	            	<td><s:property value="designArtifact.input"/></td>
	            </tr>
	            
	            <tr>
	            	<td>performance request</td>
	            	<td><s:property value="designArtifactRequest.perfrequest"/></td>
	            	<td><s:property value="designArtifact.perfrequest"/></td>
	            </tr>
	            
	            <tr>
	            	<td>security request</td>
	            	<td><s:property value="designArtifactRequest.securityrequest"/></td>
	            	<td><s:property value="designArtifact.securityrequest"/></td>
	            </tr>
	            
	            <tr>
	            	<td>storage request</td>
	            	<td><s:property value="designArtifactRequest.storagerequest"/></td>
	            	<td><s:property value="designArtifact.storagerequest"/></td>
	            </tr>
	            
	            <tr>
	            	<td>inner interface</td>
	            	<td><s:property value="designArtifactRequest.innerinterface"/></td>
	            	<td><s:property value="designArtifact.outerinterface"/></td>
	            </tr>
	            
	        </tbody>
        </s:if>
        
        
        
        
        
          <s:if test='artifacttype == "implementation"'>
	        <tbody>
	            <tr>
	            	<td>title</td>
	            	<td><s:property value="implementationArtifactRequest.title"/></td>
	            	<td><s:property value="implementationArtifact.title"/></td>
	            </tr>
	            <tr>
	            	<td>author</td>
	            	<td><s:property value="implementationArtifactRequest._authorname"/></td>
	            	<td><s:property value="implementationArtifact._authorname"/></td>
	            </tr>
	             <tr>
	            	<td>function</td>
	            	<td><s:property value="implementationArtifactRequest.function"/></td>
	            	<td><s:property value="implementationArtifact.function"/></td>
	            </tr>
	            
	             <tr>
	            	<td>input</td>
	            	<td><s:property value="implementationArtifactRequest.input"/></td>
	            	<td><s:property value="implementationArtifact.input"/></td>
	            </tr>
	            
	             <tr>
	            	<td>processing steps</td>
	            	<td><s:property value="implementationArtifactRequest.processingsteps"/></td>
	            	<td><s:property value="implementationArtifact.processingsteps"/></td>
	            </tr>
	            
	             <tr>
	            	<td>algorithm</td>
	            	<td><s:property value="implementationArtifactRequest.algorithm"/></td>
	            	<td><s:property value="implementationArtifact.algorithm"/></td>
	            </tr>
	            
	             <tr>
	            	<td>error handling</td>
	            	<td><s:property value="implementationArtifactRequest.errorhandling"/></td>
	            	<td><s:property value="implementationArtifact.errorhandling"/></td>
	            </tr>
	            
	             <tr>
	            	<td>language</td>
	            	<td><s:property value="implementationArtifactRequest.language"/></td>
	            	<td><s:property value="implementationArtifact.language"/></td>
	            </tr>
	            
	             <tr>
	            	<td>code</td>
	            	<td><s:property value="implementationArtifactRequest.code"/></td>
	            	<td><s:property value="implementationArtifact.code"/></td>
	            </tr>
	            
	             <tr>
	            	<td>priority</td>
	            	<td><s:property value="implementationArtifactRequest.priority"/></td>
	            	<td><s:property value="implementationArtifact.priority"/></td>
	            </tr>
	            
	             <tr>
	            	<td>effort</td>
	            	<td><s:property value="implementationArtifactRequest.effort"/></td>
	            	<td><s:property value="implementationArtifact.effort"/></td>
	            </tr>
	            
	             <tr>
	            	<td>cost</td>
	            	<td><s:property value="implementationArtifactRequest.cost"/></td>
	            	<td><s:property value="implementationArtifact.cost"/></td>
	            </tr>
	            
	             <tr>
	            	<td>risk</td>
	            	<td><s:property value="implementationArtifactRequest.risk"/></td>
	            	<td><s:property value="implementationArtifact.risk"/></td>
	            </tr>
	            
	             <tr>
	            	<td>comment</td>
	            	<td><s:property value="implementationArtifactRequest.comment"/></td>
	            	<td><s:property value="implementationArtifact.comment"/></td>
	            </tr>
	            
	            
	            
	             <tr>
	            	<td>latest updater</td>
	            	<td><s:property value="implementationArtifactRequest._updatername"/></td>
	            	<td><s:property value="implementationArtifact._updatername"/></td>
	            </tr>
	            
	             <tr>
	            	<td>version</td>
	            	<td><s:property value="implementationArtifactRequest.version"/></td>
	            	<td><s:property value="implementationArtifact.version"/></td>
	            </tr>
	            
	             <tr>
	            	<td>status</td>
	            	<td><s:property value="implementationArtifactRequest.status"/></td>
	            	<td><s:property value="implementationArtifact.status"/></td>
	            </tr>
	            
	        </tbody>
        </s:if>
        
        
        
         <s:if test='artifacttype == "testcase"'>
	        <tbody>
	            <tr>
	            	<td>title</td>
	            	<td><s:property value="testArtifactRequest.title"/></td>
	            	<td><s:property value="itestArtifact.title"/></td>
	            </tr>
	            <tr>
	            	<td>test case type</td>
	            	<td><s:property value="testArtifactRequest.testcasetype"/></td>
	            	<td><s:property value="itestArtifact.testcasetype"/></td>
	            </tr>
	             <tr>
	            	<td>version</td>
	            	<td><s:property value="testArtifactRequest.version"/></td>
	            	<td><s:property value="itestArtifact.version"/></td>
	            </tr>
	             <tr>
	            	<td>status</td>
	            	<td><s:property value="testArtifactRequest.status"/></td>
	            	<td><s:property value="itestArtifact.status"/></td>
	            </tr>
	             <tr>
	            	<td>priority</td>
	            	<td><s:property value="testArtifactRequest.priority"/></td>
	            	<td><s:property value="itestArtifact.priority"/></td>
	            </tr>
	             <tr>
	            	<td>precondition</td>
	            	<td><s:property value="testArtifactRequest.precondition"/></td>
	            	<td><s:property value="itestArtifact.precondition"/></td>
	            </tr>
	             <tr>
	            	<td>input</td>
	            	<td><s:property value="testArtifactRequest.input"/></td>
	            	<td><s:property value="itestArtifact.input"/></td>
	            </tr>
	             <tr>
	            	<td>test data</td>
	            	<td><s:property value="testArtifactRequest.testdata"/></td>
	            	<td><s:property value="itestArtifact.testdata"/></td>
	            </tr>
	             <tr>
	            	<td>steps</td>
	            	<td><s:property value="testArtifactRequest.steps"/></td>
	            	<td><s:property value="itestArtifact.steps"/></td>
	            </tr>
	             <tr>
	            	<td>expected result</td>
	            	<td><s:property value="testArtifactRequest.expectedresult"/></td>
	            	<td><s:property value="itestArtifact.expectedresult"/></td>
	            </tr>
	             <tr>
	            	<td>post condition</td>
	            	<td><s:property value="testArtifactRequest.postcondition"/></td>
	            	<td><s:property value="itestArtifact.postcondition"/></td>
	            </tr>
	             <tr>
	            	<td>effort</td>
	            	<td><s:property value="testArtifactRequest.effort"/></td>
	            	<td><s:property value="itestArtifact.effort"/></td>
	            </tr>
	             <tr>
	            	<td>risk</td>
	            	<td><s:property value="testArtifactRequest.risk"/></td>
	            	<td><s:property value="itestArtifact.risk"/></td>
	            </tr>
	             <tr>
	            	<td>comment</td>
	            	<td><s:property value="testArtifactRequest.comment"/></td>
	            	<td><s:property value="itestArtifact.comment"/></td>
	            </tr>
	             <tr>
	            	<td>latest updater</td>
	            	<td><s:property value="testArtifactRequest._updatername"/></td>
	            	<td><s:property value="itestArtifact._updatername"/></td>
	            </tr>
	             <tr>
	            	<td>updated times</td>
	            	<td><s:property value="testArtifactRequest.updatedtimes"/></td>
	            	<td><s:property value="itestArtifact.updatedtimes"/></td>
	            </tr>
	        </tbody>
        </s:if>
        
    </table>
    <div>
        <p><b>Evaluation Summary:</b></p>
        <ul>
            <li>effort: <b><s:property value="effortChange"/></b></li>
            <li>dependencies: <b><s:property value="dependencies"/></b></li>
            <li>Priority: <b><s:property value='priority'/></b></li>
            <li>Risk: <b><s:property value='risk'/></b></li>
        </ul>
        
    </div>
    <div>
        <input type="button" value="accept"/>
        <input type="button" value="decline"/>
    </div>
    </div>
    <div class="push"></div>
  	<div id="footer" style="background-color:#5c87b2;">
  	  <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border:hidden;background-color:#5c87b2;">							
		<tbody style="border:hidden">
			<tr style="border: hidden">	
				<td width="160" style="border: hidden">&nbsp;</td>											   		<td>									
				<table width="60%" border="0" cellspacing="0" cellpadding="0" style="border:hidden;">	
					<tbody style="border: hidden">
						<tr style="border: hidden">
							<td height="20px"><font color='#ffffff'>©2012 Copyright NJU SEI RMT team</font></td>										
						</tr>										
						<tr style="border: hidden">											
							<td height="20px"><font color='#ffffff'>2012 graduation project: requirement management tool</font></td>	
						</tr>										
						<tr style="border: hidden">					
							<td height="20px"><font color='#ffffff'>project homepage：http://code.google.com/p/rmt-ss/</font></td>		
						</tr>									
					</tbody>
				</table>								
				</td>							
			</tr>						
		</tbody>
	</table>	
  	</div>
    </div>
  </body>
</html>
